.\"     Title: saxon
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\"      Date: February 2008
.\"    Manual: 
.\"    Source: 
.\"
.TH "SAXON" "1" "February 2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
saxon - command line XSLT 2.0 processor
.SH "SYNOPSIS"
.HP 12
\fBsaxon\fR [\fIOPTION\fR...] [\fB\-s:\fR\fB\fISOURCEFILE\fR\fR] [\fB\-xsl:\fR\fB\fISTYLESHEET\fR\fR] [\fB\-o:\fR\fB\fIOUTPUT\fR\fR] [\fINAME\fR=\fIVALUE\fR...]
.SH "DESCRIPTION"
.PP
This manual page documents briefly the
\fBsaxon\fR
command\. This page was written for the
Debian(TM)
distribution because the original program does not have a manual page\. Instead, it has HTML documentation which is shipped in the "saxon\-manual" package\.
.PP
\fBsaxon\fR
is a command line wrapper around the Saxon\-B XSLT and XQuery processor\. Using
\fBsaxon\fR
you can process XML documents with
\fIXSLT 2\.0\fR
stylesheets directly from the command line\. Internally,
\fBsaxon\fR
is a wrapper around the Java class
\fBnet\.sf\.saxon\.Transform\fR
implemented by Saxon\-B\.
.PP
\fBsaxon\fR
is usually invoked passing the 3 options made explicit in the above synopsis\. Usually, those options correspond respectively to the input XML file to be transformed, the XSLT stylesheet describing the desired transformation, and the output file where to save the result\. However, the meaning and the need of passing them is affected by a number of other options that can be specified\. See the option reference below for more information\.
.SS "Parameters"
.PP
At the end of the command line, a list of
\fIparameters\fR
can be given\. Parameters are passed using the syntax
\fINAME\fR=\fIVALUE\fR, to specify parameters\' names and values\.
.PP
A parameter name prefixed with "+" (plus sign) will be interpreted as a
\fIfilesystem path parameter\fR
If the path points to a single file, that file will be parsed as XML and its document node will be passed as the parameter value\. If the path points to a directory, all directly contained files will be parsed as XML files, and the sequence of their document nodes will be passed as the parameter value\.
.PP
A parameter name prefixed with "!" (exclamation mark) will be interpted as a output/serialization parameter\. See the specifications of XQuery and XSLT 2\.0 for more information on output/serialization parameters\.
.PP
To pass parameters belonging to the non\-null namespace, the syntax {\fIuri\fR}\fIlocalname\fR=\fIvalue\fR
is provided\.
.PP
Parameters will be visible as global variables during XSLT processing, provided they have been declared with <xsl:param>\. evaluation, provided they have been declared in the query prolog\. See the XSLT specification for more information on variables and their declarations\.
.SH "OPTIONS"
.PP
A summary of supported options is included below\. Options can be passed in any order\.
.PP
We first report the options which are shared by
\fBsaxon\fR
and
\fBsaxonq\fR, then those specific to
\fBsaxon\fR
(or which have a different semantics)\.
.PP
Some options are flagged as "Saxon\-SA only", such options work only if Saxon\-SA is installed\. Note that Saxon\-SA is a commercial product, as such it is not available in Debian\.
.SS "Common options"
.PP
\fB\-cr\fR:\fIclassname\fR
.RS 4
Specify a class to be used for processing collection URIs passed to the
\fBcollection()\fR
function\. The class must implement
net\.sf\.saxon\.CollectionURIResolver\.
.RE
.PP
\fB\-dtd\fR: {[on] | [off]}
.RS 4
Enable or disable DTD validation\. Default: off\.
.RE
.PP
\fB\-expand\fR: {[on] | [off]}
.RS 4
When validation is enabled, expand default values in validated documents\. This option enables or disables such an expansion\. Default: on\.
.RE
.PP
\fB\-explain\fR [:\fIfilename\fR]
.RS 4
Display an execution plan; the output is in XML format\. If filename is not given it will be displayed on standard output\.
.RE
.PP
\fB\-ext\fR: {[on] | [off]}
.RS 4
Enable or disable the ability to invoke external Java functions from query files and stylesheets\. Beware that enabling them is a potential security risk when processing untrusted files\. Default: off\.
.RE
.PP
\fB\-l\fR: {[on] | [off]}
.RS 4
Keep (when on) or throw away (when off) line numbers in tress corresponding to source documents\. When kept, line numbers can be accessed using the function
\fBsaxon:line\-number()\fR\. Default: off\.
.RE
.PP
\fB\-outval\fR: {[recover] | [fatal]}
.RS 4
When validation is required, set whether validation errors are fatal (when "fatal" is passed) or if they only trigger warnings (when "recover" is)\. Default: fatal\.
.RE
.PP
\fB\-p\fR: {[on] | [off]}
.RS 4
Enable or disable usage of the
PTreeURIResolver\. Saxon\-SA only\.
.RE
.PP
\fB\-r\fR:\fIclassname\fR
.RS 4
Specify a class to be used for resolving all URIs\.
.RE
.PP
\fB\-repeat\fR:\fIN\fR
.RS 4
Repeat the transformation N times\. For benchmarking purposes\.
.RE
.PP
\fB\-sa\fR
.RS 4
Perform Schema\-aware processing\. Saxon\-SA only\.
.RE
.PP
\fB\-strip\fR: {[all] | [none] | [ignorable]}
.RS 4
Specify whitespace stripping policy for source documents: strip all of them ("all"), strip none of them ("none"), strip ignorable whitespace only ("ignorable")\. Default: none\.
.RE
.PP
\fB\-t\fR
.RS 4
Display version, timing, and other debugging information on standard error\.
.RE
.PP
\fB\-tree\fR: {[tiny] | [linked]}
.RS 4
Select the implementation of the internal tree model: tiny tree model ("tiny") or linked tree model ("linked")\. See the Saxon documentation for more information on the internal tree model\. Default: tiny\.
.RE
.PP
\fB\-T\fR [:\fIclassname\fR]
.RS 4
Trace various aspect of the processing; an optional class name can be given to specify a user\-chosen tracer\. The class must implement
net\.sf\.saxon\.trace\.TraceListener\. The default is a system supplied tracer\. This option implies
\fB\-l\fR\.
.RE
.PP
\fB\-TJ\fR
.RS 4
Enable tracing of external Java method invocation\. See
\fB\-ext\fR\.
.RE
.PP
\fB\-u\fR
.RS 4
Force interpretation of source document names as URI\. By default they are considered to be file names, unless they start with "file:" or "http:"\.
.RE
.PP
\fB\-val\fR: {[strict] | [lax]}
.RS 4
When validation is enabled, choose among "strict" or "lax" validation\. Saxon\-SA only\.
.RE
.PP
\fB\-x\fR:\fIclassname\fR
.RS 4
Specify a class to be used as SAX parser for input documents\. The class must implement either
org\.xml\.sax\.Parser
or
org\.xml\.sax\.XMLReader\.
.RE
.PP
\fB\-xi\fR
.RS 4
Apply XInclude processing to all input documents\.
.RE
.PP
\fB\-xmlversion\fR: {[1\.0] | [1\.1]}
.RS 4
Choose the XML version for processing input documents\. "1\.1" must be specified to process XML 1\.1 and Namespaces 1\.1 constructs\. Default: 1\.0\.
.RE
.PP
\fB\-?\fR
.RS 4
Display a help message and exit\.
.RE
.SS "Options specific to saxon"
.PP
\fB\-a\fR
.RS 4
Use the "<?xml\-stylesheet \.\.\. ?>" processing instruction from the source document to find the stylesheet to be used\. This option is not compatible with
\fB\-xsl\fR\.
.RE
.PP
\fB\-c\fR:\fIfilename\fR
.RS 4
Use the compiled stylesheet stored in filename\. This option is not compatible with
\fB\-xsl\fR\.
.RE
.PP
\fB\-im\fR:\fImodename\fR
.RS 4
Use modename as the initial mode used for the transformation\. Qualified modes can be specified as "{\fIuri\fR}\fIlocalname\fR"\.
.RE
.PP
\fB\-it\fR:\fItemplatename\fR
.RS 4
Use templatename as the initial named template for the transformation\. When this option is used,
\fB\-xsl\fR
is optional\.
.RE
.PP
\fB\-m\fR:\fIclassname\fR
.RS 4
Specify a class to be used as the receiver for messages generated by <xsl:message>\. The class must implement
net\.sf\.saxon\.event\.Receiver\.
.RE
.PP
\fB\-o\fR:\fIpath\fR
.RS 4
Specify the path to be used for saving generated output\. Usually path points to a filename where the main result document will be saved\. If not specified such a document will be written to standard output\.
.sp
Additional output documents generated using the <xsl:result\-document> command uses path as the basename for the "href" attribute of the command\. If
\fB\-o\fR
is missing they will be saved relatively to the current working directory\.
.sp
When
\fB\-s\fR
identifies a directory, also
\fB\-o\fR
should identify one\. All the output documents will then be written under such a directory\.
.RE
.PP
\fB\-or\fR:\fIclassname\fR
.RS 4
Specify a class to be used as the output resolver for the "href" attribute of <xsl:result\-document>\. The class must implement
net\.sf\.saxon\.OutputURIResolver\.
.RE
.PP
\fB\-s\fR:\fIpath\fR
.RS 4
Specify the input file or directory\. This option is required unless
\fB\-it\fR
has been given\. If path points to a filename, that file will be parsed as an XML document and its document node will be the context item at the beginning of the transformation\. The special filename "\-" can be used to require reading the input document from standard input\.
.sp
If path points to a directory all files directly contained in it will be individually transformed\. In such a case
\fB\-o\fR
is required\.
\fB\-u\fR
affects the intepretation of path\.
.RE
.PP
\fB\-versmsg\fR: {[on] | [off]}
.RS 4
Enable or disable the warning about using an XSLT 2\.0 processor (which Saxon\-B is) on stylesheets which specify version="1\.0" in their root element\. Default: on\.
.RE
.PP
\fB\-warnings\fR: {[silent] | [recover] | [fatal]}
.RS 4
Set the policy for handling recoverable errors: "silent" for silent recovery, "recover" for recovery with warning output on standard error, "fatal" for no recovery\. Default: recover\.
.RE
.PP
\fB\-xsl\fR:\fIfilename\fR
.RS 4
Specify the main XSLT stylesheet to be used for the transformation\. This option is required unless
\fB\-a\fR
or
\fB\-c\fR
are specified\. The special filename "\-" can be used to require reading the sylesheet from standard input\.
\fB\-u\fR
affects the intepretation of filename\.
.RE
.PP
\fB\-y\fR:\fIfilename\fR
.RS 4
Specify a class to be used as SAX parser for stylesheets\. The class must implement either
org\.xml\.sax\.Parser
or
org\.xml\.sax\.XMLReader\. See also
\fB\-x\fR\.
.RE
.SH "SEE ALSO"
.PP
saxonq (1), XSL Transformations (XSLT) Version 2\.0 (W3C Recommendation)\.
.PP
This program is fully documented by the HTML documentation of Saxon, available in the "saxon\-manual" package\.
.SH "AUTHOR"
.PP
This manual page was written by
Stefano
Zacchiroli
<zack@debian\.org>
for the
Debian(TM)
system (but may be used by others)\. Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU
General Public License, Version 3 or any later version published by the Free Software Foundation\.
.PP
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common\-licenses/GPL\.
.SH "COPYRIGHT"
Copyright \(co 2008 Stefano Zacchiroli
.br
